package com.ruoyi.business.exception;



/**
 * 自定义异常
 *
 * @author waoqi
 */
public class TradeException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Integer code;

    private String message;

    public TradeException(String message) {
        this.message = message;
    }

    public TradeException(CodeMsg cm) {
        super(cm.getMsg());
        this.code = cm.getCode();
        this.message = cm.getMsg();
    }

    public TradeException(CodeMsg cm, String msg) {
        super(cm.getMsg());
        this.code = cm.getCode();
        this.message = msg;
    }

    public TradeException(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    public TradeException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }
}
